package com.studyadmin.controller;


import com.studyadmin.entity.Class;
import com.studyadmin.entity.Student;
import com.studyadmin.service.ClassService;
import com.studyadmin.util.JsonUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 * 班级表 前端控制器
 * </p>
 *
 * @author lyl
 * @since 2023-04-01
 */
@RestController
@RequestMapping("/studyadmin/class")
@CrossOrigin
public class ClassController {
    @Autowired
    ClassService classService;

    @RequestMapping("/classList")
    public JsonUtil SelClassList(){
        List<Class> list=classService.list();
        JsonUtil jsonUtil = new JsonUtil();
        jsonUtil.setCode(0);
        jsonUtil.setData(list);
        return jsonUtil;
    }

}

